#!/bin/bash

# Copyright (c) 2021-2023 HiHope Open Source Organization .
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -e

ROOT_DIR=../../../../../
echo "############begin##############"

HAP_PATH=${ROOT_DIR}/applications/standard/hap/
Boot_Animation_PATH=${ROOT_DIR}/foundation/graphic/graphic_2d/frameworks/bootanimation/data/
BUILD_PATH=${ROOT_DIR}/build/
powermgr_PATH=${ROOT_DIR}/base/powermgr/power_manager/services/native/profile/
RK3568_SOC_PATH=${ROOT_DIR}/device/soc/rockchip/
WPA_PATH=${ROOT_DIR}/third_party/wpa_supplicant/
DISK_CONFIG_PATH=${ROOT_DIR}/foundation/filemanagement/storage_service/services/storage_daemon/
echo "############build##############"
cp -arf ./build/* ${BUILD_PATH}/
echo "############BootAnimation##############"
cp -arf ./BootAnimation/bootvideo.mp4 ${Boot_Animation_PATH}/bootvideo.mp4
echo "############Hap##############"
cp -arf ./hap/* ${HAP_PATH}/
echo "############power##############"
cp -arf ./powermgr/power_mode_config.xml ${powermgr_PATH}/power_mode_config.xml
echo "############wifi##############"
cp -arf ./soc/* ${RK3568_SOC_PATH}/

cp -arf ./wpa_supplicant-2.9_standard/* ${WPA_PATH}/
echo "############interface##############"

echo "############disk_config############"
cp -arf ./foundation/filemanagement/storage_service/services/storage_daemon/disk_config ${DISK_CONFIG_PATH}disk_config

echo "############init.cfg###############"
cp -arf ./base/startup/init/services/etc/init.cfg ${ROOT_DIR}/base/startup/init/services/etc/init.cfg

echo "############ueventd.config###############"
cp -arf ./base/startup/init/ueventd/etc/ueventd.config ${ROOT_DIR}/base/startup/init/ueventd/etc/ueventd.config

echo "############kernel config##########"
cp -arf ./kernel/linux/config/linux-5.10/rk3568/arch/arm64_defconfig ${ROOT_DIR}/kernel/linux/config/linux-5.10/rk3568/arch/arm64_defconfig

echo "############success##############"


